<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ include file="include/base.jsp" %>
<!DOCTYPE HTML>
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<title></title>
	<link rel="stylesheet" href="css/bootstrap.css">
	<link type="text/css" href="jquery-ui/css/ui-lightness/jquery-ui-1.8.24.custom.css" rel="stylesheet" /> 
	<link type="text/css" href="jquery-ui/css/ui-lightness/pack_datepicker.css" rel="stylesheet" /> 
	<link rel="stylesheet" href="jssuggest/jquery.suggest.css">
	<style type="text/css">
		#note{
			position:relative;
		}
		.shownote{
			position:relative;
		}
		.pic{
			position:absolute;
			
			left:15px;
		}
		.about{
			position:absolute;
			width:150px;
			left:70px;
		}
		.body{
			position:absolute;
			
			left:70px;
		}
		.alert{
			position:absolute;
			top:70px;
			left:70px;
			
		}
		.mydiv{
			width:60px;
			height:25px;
			background-image:url(img/all.png);
			background-repeat:no-repeat;
			background-position:0px -401px;
			margin-left:-60px;
			display:none;
		}
		.taskdiv{
			position:absolute;
			width:60px;
			height:25px;
			background-image:url(img/all.png);
			background-repeat:no-repeat;
			background-position:0px -401px;
			top:17px;
			left:-45px;
			display:none;
		}
		.mynote{
			display:none;
		}
		#container{
			position:relative;
		}
		
		ul li{
			border-bottom:1px solid #eee;
		}
		#last{
			width:50px;
			height:32px;
			background-position:-112px -148px;
			background-image:url(img/all.png);
		}
		#myinfo{
			position:relative;
		}
		#myname{
			position:absolute;
			top:3px;
			left:35px;
		}
		#lock{
			width:10px;
			height:12px;
			background-position:-560px 0px;
			background-image:url(img/all.png);
			position:absolute;
			top:3px;
			left:65px;
		}
		.search{
			width:14px;
			height:12px;
			background-position:-142px -181px;
			background-image:url(img/all.png);
			position:absolute;
			top:3px;
			left:78px;
		}
		.tool:hover{
			text-decoration:none;
		}
		#bott{
			position:relative;
		}
		#myoption2{
			position:absolute;
			top:100px;
			left:200px;
		}
		.delpic{
			width:14px;
			height:14px;
			background-position:-189px -181px;
			background-image:url(img/all.png);
		}
		#info{
			position:relative;
		}
		.box{width:250px; height:380x; border:1px solid #d4693e; border-radius:5px; margin-top: 47px; position:absolute; background-color: #fff;top:5px;left:-5px;z-index:3}
        .a1,.a2{width:0; height:0; overflow:hidden; border-width:10px; border-style:dotted dotted solid;  position:absolute}
        .abox{position: absolute; width:20px; height: 20px; left:20px; top:-20px}
        .a1{border-color:transparent transparent #D4693E;  top:-1px}
        .a2{border-color:transparent transparent #FFFFFF;  top:0}
        .comment{position:relative;padding:10px;background:#fff; border-radius:3px;border:1px solid #e1e4e5;width:250px;z-index:4;margin-right:100px;}
		.arrow {display:block;_display:none;position:absolute;overflow:hidden;}
		.arrow .out,.arrow .inside{ font-family:黑体;font-weight:bold;font-size:16px; }
		.arrow .out{display:inline-block;overflow:hidden;color:#e1e4e5;}
		.arrow .inside{position:absolute;color:#fbfbfb;}
		.arXYr {top:9px;right:-9px;}
		.aiXYr {top:0px;right:1px;}
		.mytask{
			position:relative;
		}
		.mycomment{
			position:absolute;
			top:60px;
			left:-260px;
			
		}
			
		}
	</style>
</head>
<body style="background-color:#f3f1ec">
	<div class="navbar" >
	  <div class="navbar-inner" style="height:60px">
		<a class="brand" href="javascript:;"><img src="img/logo-topleft.png" alt="" /></a>
		<a href="javascript:;" class="btn btn-info" style="margin-top:12px;margin-left:10px">添加日程</a>
		<a href="javascript:;" class="btn btn-info" style="margin-top:12px">添加联系人</a>
		
		<div class="btn-group pull-right">
            <a class="btn dropdown-toggle" data-toggle="dropdown" href="javascript:;">
               <i class="icon-user"></i>${sessionScope.cur_user.username }
              <span class="caret"></span>
            </a>
            <ul class="dropdown-menu">
              <li><a href="javascript:;"><i class="icon-cog"></i>　密码设置</a></li>
              <li class="divider"></li>
              <li><a href="javascript:;"><i class="icon-off"></i>　安全退出</a></li>
            </ul>
          </div>
		</div>
	</div>
	<div class="row-fluid">
		<div class="span3" style="height:400px">
				<div class="wall" style="padding:8px 0;">
					<ul class="nav nav-list" >
						<li class="nav-header" style="padding-top:0px">Welcome!</li>
						<li class="divider"><br></li>
						<li ><a href="home.action"><i class="icon-white icon-home"></i>最新动态</a></li>
						<li><a href="contactlist.action"><i class="icon-user"></i>联系人</a></li>
						<li><a href="task/toCalendar.action"><i class="icon-leaf"></i>日程</a></li>
						<li class="active"><a href="deal.action"><i class="icon-gift"></i>交易</a></li>
						<li><a href="emails.action"><i class="icon-gift"></i>群发邮件</a></li>
					</ul>
				</div>
		</div>
		
		<div class="span6" style="background-color:#fff;height:1000px;border:1px solid #ccc;border-radius:2px;margin-left:5px;" id="">
			<div id="container">
			<div class="wall" style="border-bottom:1px solid #ccc;">
				<div style="background-color:#f0f5f8;height:113px;padding-top:3px">
					<div style="float:left"><img src="img/yen_coin.png" alt="" /></div>
					<div style="float:left">
						<strong style="font-size:14px">${deal.contactList[0].username }:${deal.name }</strong><br />
						<strong >Strategy Consulting</strong>—￥${deal.money }&nbsp;${deal.weavestate }<br />
						${deal.user.username } is responsible
					</div>
					<div style="float:right">
						<a href="editDeal.action?id=${deal.id }" style="margin-left:200px">修改交易</a>&nbsp;<a href="javascript:;" id="dealDeal"><i class="icon-trash" title="删除"></i>删除交易</a>
						<div class="btn-group" data-toggle="buttons-radio" style="border-radius:4px;margin-left:200px;">
							<a  class="btn" id="pending">跟踪</a>
							 <a  class="btn" id="won">赢得</a>
							 <a  class="btn" id="lost">丢失</a>
						</div>
					</div>
					
				</div>
				
			</div>
			
			<div style="margin-top:30px;margin-left:30px">
			
				<form >
				  
				  
					<strong>添加记录</strong><br />
					
				  <textarea name="content" id="content" class="span11" rows="4"></textarea>
				  <span class="help-block"><a href="javascript:;" id="showoptions">显示选项</a><a href="javascript:;" class="btn btn-info" id="addbtn" style="margin-left:340px" >添加记录</a></span>
				 <div style="display:none;" id="myoption">
					<div class="control-group">
					<label><strong>跟踪这个人添加一条记录</strong><br />
						这只限于在这条交易中的人,并以邮件通知该对象
					</label>
					<div class="controls">
						<select style="margin-left:2px" name="touser" id="touser">
								<option value="不选">不选</option>
							<c:forEach items="${deal.contactList }" var="contact">
								<option value="${contact.username }">${contact.username }</option>
							</c:forEach>
							
							
						</select>
					</div>
				  </div>
				  <div class="control-group">
					
					<div class="controls">
						<div class="control-group">
						<label class="control-label"><strong>什么时候发生</strong></label>
						<div class="controls">
							<input type="text" class="span3"  name="begintime" id="datepicker" value="2012-10-14"/>
						</div>
					</div>
					</div>
				  </div>
				  <div class="control-group">
					<label>
						什么人可见
					</label>
					<div class="controls">
						<select style="margin-left:2px" id="views">
							<option value="所有人">所有人</option>
							<option value="只有我">只有我</option>
							<option value="同组">我和同组的人</option>
						</select>
					</div>
				  </div>
				  <input type="hidden" value="${deal.id }" id="dealid">
				  <input type="hidden" value="${deal.state }" id="state">
				  <input type="button" class="btn btn-info" value="添加记录" id="add"/><a href="javascript:;" id="close" style="margin-left:5px;">关闭</a>
				 </div>
				 
				</form>
				
			</div>
			
			
			
			<div style="margin-top:30px;margin-left:10px;">
				<div style="height:120px;display:none;margin-bottom:31px;padding-top:5px;border-bottom:1px solid #eee;"  class="new">
					<div class="shownote">
						
						<div class="pic" ><img src="img/money_yen.png" alt="" />
							
						</div>
						
						<div class="about">
							<span id="notetime"></span><br/>
							<strong style="color:#777;">${sessionScope.cur_user.username }</strong>添加的记录.<br/>
							
						</div>
						<div class="body" style="margin-top:50px;">
							<span id="notecontent" style="color:#ff706c"></span>
						</div>
						
						<div class="mydiv">
							
								<a href="javascript:;" title="删除" id="delNewNote"><i class="icon-trash" style="margin-left:3px;margin-top:3px;" ></i></a>
								<a href="javascript:;" style="font-size:10px;color:red;text-decoration:underline" id="editNewnote">修改</a>
							
						</div>
						
				
					</div>
				<div style="display:none;margin-left:20px;" >
				  
				<form action="editDealNote.action?dealid=${deal.id}" method="post">
					<strong>修改记录</strong><br />
					
				  	<textarea name="note.content" id="newcontent" class="span9" rows="3">${note.content }</textarea>
				   <span class="help-block"><a href="#modal2" role="button"  data-toggle="modal" >显示选项</a>&nbsp;&nbsp;<a href="javascript:;"  class="closebtn">取消</a>&nbsp;&nbsp;<a href="javascript:;"  class="complete">修改</a></span>
				   <div class="modal hide fade" id="modal2">
				   <div class="modal-header">
				   		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				   	 	<h3>修改记录</h3>
				  </div>
				  <div class="modal-body">
				     <div >
						<div class="control-group">
							<label><strong>跟踪这个人添加一条记录</strong>
								
							</label>
						<div class="controls">
							<select style="margin-left:2px" name="newcontactName" id="touser">
									<option value="不选">不选</option>
								<c:forEach items="${deal.contactList }" var="contact">
									<option value="${contact.username }">${contact.username }</option>
								</c:forEach>
								
								
							</select>
						</div>
				  		</div>
				  <div class="control-group">
					
					<div class="controls">
						<div class="control-group">
							<label class="control-label"><strong>什么时候发生</strong></label>
							<div class="controls">
								<input type="text" class="span3"  name="note.createtime" id="datepicker3" value="${note.createtime }"/>
							</div>
						</div>
					</div>
				  </div>
				  <div class="control-group">
					<label>
						什么人可见
					</label>
					<div class="controls">
						<select style="margin-left:2px" name="note.views" id="newviews">
							<c:choose>
								<c:when test="${note.views == '所有人' }">
									<option value="所有人" selected="selected">所有人</option>
								</c:when>
								<c:otherwise>
									<option value="所有人">所有人</option>
								</c:otherwise>
							</c:choose>
							<c:choose>
								<c:when test="${note.views == deal.user.username }">
									<option value="只有我" selected="selected">只有我</option>
								</c:when>
								<c:otherwise>
									<option value="只有我">只有我</option>
								</c:otherwise>
							</c:choose>
							<c:choose>
								<c:when test="${note.views == deal.user.group.name }">
									<option value="同组" selected="selected">我和同组的人</option>
								</c:when>
								<c:otherwise>
									<option value="同组">我和同组的人</option>
								</c:otherwise>
							</c:choose>
							
							
						</select>
					</div>
				  </div>
				 </div>
				  </div>
					<div class="modal-footer">
					   <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
					    <button  type="submit" class="btn btn-primary">保存</button>
					 </div>
				</div>
			</form>
				
			</div>	
				</div>
				<c:forEach items="${noteList }" var="note">
				<div style="height:120px;border-bottom:1px solid #eee;padding-top:10px;">
					<div class="shownote">
						
					<div id="mynote">
						<div class="pic" ><img src="img/money_yen.png" alt="" />
						
						</div>
						
						<div class="about">
							${note.createtime }<br/>
							<strong style="color:#777;">${note.user.username }</strong>添加的记录.<br/>
							
						</div>
						<div class="body" style="margin-top:50px;">
							<span style="color:#ff706c">${note.content }</span>
						</div>
					</div>
					<input type="hidden" value="${note.id }" id="noteid">
					<div class="mydiv">
						<div class="outer">
							<a href="javascript:;" title="删除" class="delnote"><i class="icon-trash" style="margin-left:3px;margin-top:3px;" ></i></a>
							<a href="javascript:;" style="font-size:10px;color:red;text-decoration:underline" class="editnote">修改</a>
						</div>
					</div>
					
				</div>
				<div style="display:none;margin-left:20px;" >
				  
				<form action="editDealNote.action?id=${note.id }&&dealid=${deal.id}" method="post">
					<strong>修改记录</strong><br />
					
				  	<textarea name="note.content" id="content" class="span9" rows="3">${note.content }</textarea>
				   <span class="help-block"><a href="#${note.id }" role="button"  data-toggle="modal" >显示选项</a>&nbsp;&nbsp;<a href="javascript:;"  class="closebtn">取消</a>&nbsp;&nbsp;<a href="javascript:;"  class="complete">修改</a></span>
				   <div class="modal hide fade" id="${note.id }">
				   <div class="modal-header">
				   		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				   	 	<h3>修改记录</h3>
				  </div>
				  <div class="modal-body">
				     <div >
						<div class="control-group">
							<label><strong>跟踪这个人添加一条记录</strong>
								
							</label>
						<div class="controls">
							<select style="margin-left:2px" name="contactName" id="touser">
									<option value="不选">不选</option>
								<c:forEach items="${deal.contactList }" var="contact">
									<option value="${contact.username }">${contact.username }</option>
								</c:forEach>
								
								
							</select>
						</div>
				  		</div>
				  <div class="control-group">
					
					<div class="controls">
						<div class="control-group">
							<label class="control-label"><strong>什么时候发生</strong></label>
							<div class="controls">
								<input type="text" class="span3"  name="note.createtime" id="datepicker2" value="${note.createtime }"/>
							</div>
						</div>
					</div>
				  </div>
				  <div class="control-group">
					<label>
						什么人可见
					</label>
					<div class="controls">
						<select style="margin-left:2px" name="note.views">
							<c:choose>
								<c:when test="${note.views == '所有人' }">
									<option value="所有人" selected="selected">所有人</option>
								</c:when>
								<c:otherwise>
									<option value="所有人">所有人</option>
								</c:otherwise>
							</c:choose>
							<c:choose>
								<c:when test="${note.views == deal.user.username }">
									<option value="只有我" selected="selected">只有我</option>
								</c:when>
								<c:otherwise>
									<option value="只有我">只有我</option>
								</c:otherwise>
							</c:choose>
							<c:choose>
								<c:when test="${note.views == deal.user.group.name }">
									<option value="同组" selected="selected">我和同组的人</option>
								</c:when>
								<c:otherwise>
									<option value="同组">我和同组的人</option>
								</c:otherwise>
							</c:choose>
							
							
						</select>
					</div>
				  </div>
					  
				  
				 </div>
				  </div>
					<div class="modal-footer">
					   <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
					    <button  type="submit" class="btn btn-primary">保存</button>
					 </div>
				</div>
			</form>
				 
				
				
			</div>
				</div>
				
				</c:forEach>
				
				
				
				<div class="well" style="margin-top:15px;padding:0px;">
					<img src="img/new.png" alt="" />
					这条交易&nbsp;<span style="color:#056b84;">${deal.name }</span >&nbsp;由使用者&nbsp;<span style="color:#f0529f;">${deal.user.username }</span>&nbsp;在2012年5月12号创建
				</div>
				
			</div>
		
				
		</div>
		
		</div>
		<div class="span3">
				<div id="info" style="border-left:1px solid #eee;padding:8px 3px 0px 5px;" >
				<ul class="unstyled">
					<li ><strong>你的日程</strong></li>
					<li>
						<a href="javascript:;" id="addTask">添加一个日程</a>关于这个交易
						<div id="showNewTask">
						
						</div>
						<c:forEach items="${taskList }" var="task">
						<div style="margin-bottom:5px;position:relative;padding-left:15px;" class="mytask">
							<input type="hidden" value="${task.id }" class="taskid">
							
							<span class="newstate"><span class="${task.state }">${task.state }</span><br/><span><input type="checkbox" style="margin-top:-2px;" name="delcheck" class="checkbox">&nbsp;<input type="hidden" value="${task.category.color}"><span class="newCategoryType" style="border:1px solid #ccc;">${task.category.type }</span> &nbsp;<span class="newtaskContent">${task.task }</span></span> <br>
							
							</span>
							<div class="taskdiv" style="padding-top:3px;">
								<a href="javascript:;" title="删除" style="margin-left:10px;" class="deltask"><i class="icon-trash"></i></a>
								<a href="javascript:;" style="color:red;text-decoration:underline;" class="editTask">修改</a>
							</div>
					
						</div>
						
						</c:forEach>
						<div class="mycomment" >
						<div class="comment" style="float:left;display:none">
						   <div class="arrow arXYr">
						      <span class="out">◆</span>
						      <span class="inside aiXYr">◆</span>
						   </div>
						   <div>
						        <form  method="post" id="myform">
						        <span><strong>修改日程</strong></span><br/>
					        	<input type="text"  class="span8" name="task.task"  id="updateTaskName">
					        	<input type="hidden" name="task.type" value="交易">
					        	<input type="hidden" name="task.typeid" value="${deal.id }" >
					        	<div class="control-group">
										<label class="control-label" for="inputPassword">什么时候完成?或者<a href="#" style="color:green" class="updatespecifiedTime">选择具体时间</a></label>
										<div class="controls">
											<select style="margin-left:2px" name="abstractTime"  id="updateabstractTime" >
												<option value="今天">今天</option>
												<option value="明天">明天</option>
												<option value="本周">本周</option>
												<option value="下周">下周</option>
												<option value="以后">以后</option>
										
											</select>
											
											<div style="display:none;" id="updateDateTime">
												<input type="text"   name="specifiedTime" id="updateDatepicker" value="" class="span6"/>
												<a href="#" style="color:green" class="canselTime">取消</a>
											</div>
										</div>
										
								</div>
								<div class="control-group">
										<label class="control-label" for="inputPassword">选择一个类别</label>
										<div class="controls">
											<select style="margin-left:2px" name="category" class="span8" id="updateTaskCategory">
												<option value="打电话">打电话</option>
												<option value="发邮件">发邮件</option>
												<option value="发传真">发传真</option>
												<option value="开会">开会</option>
												
										
											</select><a href="#" style="color:green">修改类别</a>
										</div>
										
								</div>
								<div class="control-group">
										<label class="control-label" for="inputPassword">谁可以看见这个日程</label>
										<div class="controls">
											<select style="margin-left:2px"  class="span8" name="task.views" id="updateTaskViews">
												<option value="所有人">所有人</option>
												<option value="只有我">只有我</option>
												<option value="同组">我和同组的人</option>
												
										
											</select>
										</div>
										
								</div>
								<div style="border:1px solid #000;margin-bottom:5px;" ></div>
								<input  type ="button" class="btn btn-info" value="修改" id="updateTask" class="span2">
								<a  href="javascript:;" class="canselTaskdiv">取消</a>
						        </form>
						   </div>
						</div>
						</div>
						<div class="box" style="display:none">
					        <div class="abox">
					            <div class="a1"></div>
					            <div class="a2"></div>
					        </div>
					        <p style="font-size: 12px;">
					        	<form  style="padding-left:20px;padding-right:5px;">
					        		<span><strong>添加一个日程</strong></span><br/>
					        		<input type="text" id="mytaskContext" name="mytaskContext" class="span8">
					        		<div class="control-group">
										<label class="control-label" for="inputPassword">什么时候完成?或者<a href="#" style="color:green" id="specifiedTime">选择具体时间</a></label>
										<div class="controls">
											<select style="margin-left:2px" name="abstractTime" id="selectTime" class="span8">
												<option value="今天">今天</option>
												<option value="明天">明天</option>
												<option value="本周">本周</option>
												<option value="下周">下周</option>
												<option value="以后">以后</option>
										
											</select>
											
											<div style="display:none;" id="dateTime">
												<input type="text" class="span7"  name="specifiedTime" id="datepicker4" value="" />
												<a href="#" style="color:green" id="cansel">取消</a>
											</div>
										</div>
										
									</div>
										<div class="control-group">
										<label class="control-label" for="inputPassword">选择一个类别</label>
										<div class="controls">
											<select style="margin-left:2px" name="category" class="span8" id="mytaskCategory">
												<option value="打电话">打电话</option>
												<option value="发邮件">发邮件</option>
												<option value="发传真">发传真</option>
												<option value="开会">开会</option>
												
										
											</select><a href="#" style="color:green">修改类别</a>
										</div>
										
									</div>
									<div class="control-group">
										<label class="control-label" for="inputPassword">谁可以看见这个日程</label>
										<div class="controls">
											<select style="margin-left:2px" id="mytaskViews" class="span8">
												<option value="所有人">所有人</option>
												<option value="只有我">只有我</option>
												<option value="同组">我和同组的人</option>
												
										
											</select>
										</div>
										
									</div>
									<div style="border:1px solid #000;margin-bottom:5px;" ></div>
									<input type="button" class="btn btn-info" value="添加" id="addMytask">
									<input  type="button" class="btn btn-info" value="取消" id="canseldiv">
					        	</form>
					        </p>
					    </div>
					</li><br />
					<li>交易描述&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="editDeal.action?id=${deal.id }">修改</a></li><br />
					<li style="border-bottom:none"><span style="color:green">${deal.desc }</span></li><br />
					<li>
						<strong>这个交易都有谁</strong>&nbsp;&nbsp;<a href="javascript:;" id="addperson">添加/删除</a>
					</li>
					
				</ul>
				<div id="searchCustomer" >
					<form action="addAnotherDealContact.action?id=${deal.id }" method="post" id="another">
						
						<div class="controls">
							<div class="control-group">
							<label class="control-label"><strong>寻找客户</strong></label>
							<div class="controls">
								
								<input type="text" class="span5" name="contactName" id="searchContact"  placeholder="search"/>
								
								<span style="margin-left:10px;"><a href="javascript:;" id="addAnotherDealContact" ><img alt="" src="img/add2.png" title="添加"></a></span>
							</div>
							
							</div>
							
						</div>				  
					</form>
				</div>
				<p>已经相关的客户</p>
				<div id="myinfo" style="margin-bottom:10px;">
					
					<div id="last"></div>
					<div id="myname"><a href="javascript:;">${deal.contactList[0].username }</a><br /><small style="color:#888">${deal.contactList[0].companyName }</small></div>
					<div id="lock"></div>
					
					<div class="search"></div>
					
					<div class="pic1" style="display:none;"><a rel="tooltip" class="tool" href="javascript:;" data-original-title="<div style='width:60px;height:25px;padding-top:5px'><span style='font-size:14px;margin-right:5px'>${deal.contactList[0].username }</span><img src='img/bar-loader.gif' /></div>" style="position:absolute;top:1px;left:78px;">.&nbsp;.</a></div>
					<div class="pic2" style="display:none;"><a rel="tooltip" class="tool" href="javascript:;" data-original-title="<div style='padding-top:5px'><span style='font-size:14px;margin-right:5px'><img src='img/head.png'/>${deal.contactList[0].username }<span style='margin-right:130px;'></span><br/>${deal.contactList[0].title }&nbsp;at&nbsp;${deal.contactList[0].companyName }<span style='margin-right:100px;'></span><hr/>主页&nbsp;${deal.contactList[0].website }<span style='margin-right:50px;'></span><br/>微博&nbsp;${deal.contactList[0].weibo }<span style='margin-right:10px;'></span><br/>email&nbsp;${deal.contactList[0].email }<span style='margin-right:0px;'></span></span></div>" style="position:absolute;top:1px;left:78px;">.&nbsp;.</a></div>
					
				</div>
				<c:forEach items="${deal.contactList }" var="c">
					<c:if test="${c.id != deal.contactList[0].id}">
						<div id="myinfo" style="margin-bottom:10px;">
					
							<div id="last"></div>
							<div id="myname"><a href="javascript:;">${c.username }</a><br /><small style="color:#888">${c.companyName }</small></div>
							<div id="lock"></div>
							<input type="hidden" value="${c.id }" >
							<div class="search">
								<a href="javascript:;" class="delAnotherDealContact"><div style="margin-left:50px;display:none;" class="delpic"></div></a>
							</div>
							
							<div class="pic1" style="display:none;"><a rel="tooltip" class="tool" href="javascript:;" data-original-title="<div style='width:70px;height:25px;padding-top:5px'><span style='font-size:14px;margin-right:5px'>${c.username }</span><img src='img/bar-loader.gif' /></div>" style="position:absolute;top:1px;left:78px;">.&nbsp;.</a></div>
							<div class="pic2" style="display:none;"><a rel="tooltip" class="tool" href="javascript:;" data-original-title="<div style='padding-top:5px'><span style='font-size:14px;margin-right:5px'><img src='img/head.png'/>${c.username }<span style='margin-right:130px;'></span><br/>${c.title }&nbsp;at&nbsp;${c.companyName }<span style='margin-right:100px;'></span><hr/>主页&nbsp;${c.website }<span style='margin-right:50px;'></span><br/>微博&nbsp;${c.weibo }<span style='margin-right:10px;'></span><br/>email&nbsp;${c.email }<span style='margin-right:0px;'></span></span></div>" style="position:absolute;top:1px;left:78px;">.&nbsp;.</a></div>
					
						</div>
					</c:if>
				</c:forEach>
				
			</div>
		</div>
	</div>
			
		
			
			
		
			
			
			
			
			
			
			
			
			
			
			
			
	
	<script type="text/javascript" src="js/jquery.js" ></script>
	<script type="text/javascript" src="js/jquery.livequery.js" ></script>
	<script type="text/javascript" src="js/bootstrap.min.js" ></script>	
	<script type="text/javascript" src="jquery-ui/js/jquery-ui-1.8.24.custom.min.js"></script> 
	<script type="text/javascript" src="jquery-ui/js/ui.datepicker-zh-CN.js"></script> 
	<script type="text/javascript" src="jssuggest/jquery.suggest.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			delState();
			function delState(){
				$(".今天:not(:first)").remove();
				$(".明天:not(:first)").remove();
				$(".本周:not(:first)").remove();
				$(".下周:not(:first)").remove();
				$(".以后:not(:first)").remove();
			}
			$(".mymodal").modal();
			$("#showoptions").click(function(){
				$("#myoption").slideDown("slow"); 
				$("#addbtn").hide();
			
			});
			$(".showoptions2").click(function(){
				
				$(this).parent().next().slideDown("slow"); 
			});
			$(".shownote").live("mouseover",function(){
	
				$(this).find(".mydiv").show();
				$(this).find(".mynote").show();
			});  
			$(".shownote").live("mouseout",function(){
				$(this).find(".mydiv").hide();
				$(this).find(".mynote").hide();
			});
			$("#close").click(function(){
				$("#myoption").slideUp("slow"); 
				$("#addbtn").show();
			});
			var value = $("#addperson").html();
			$("#addperson").click(function(){
				if(value == "添加/删除"){
					$("#searchCustomer").show();
					$("#searchContact").show();
					$(".delpic").css("display","block");
					$(this).html("取消");
					value = $("#addperson").html();
				}else if(value == "取消"){
					$("#searchCustomer").hide();
					$(".delpic").hide();
					$(this).html("添加/删除");
					value = $("#addperson").html();
				}
			});
			
			
			$('.tool').tooltip({
				"placement":"left",
				"delay": 100
				});
			
			$(".search").mouseover(function(){
				$(this).next().next().show();
			});
			  
		    $("#datepicker,#datepicker2,#datepicker3,#datepicker4,.datepicker,#updateDatepicker").datepicker({  
		        changeMonth: true, changeYear: true,  
		        showOn: 'button',   
		        buttonImage: 'img/calendar.gif',   
		        buttonImageOnly: true,  
		         minDate: '-2y', maxDate: '+2y'  
		    });  
		    $("#datepicker").datepicker('option', {dateFormat:"yy-mm-dd" });  
			$("#addbtn,#add").click(function(){
				var content = $("#content").val();
				var time = $("#datepicker").val();
				var touser = $("#touser").val();
				var views = $("#views").val();
				var dealid = $("#dealid").val();
				
				$("#notetime").html(time);
				$("#notecontent").html(content);
				$(".new").fadeIn(3000,function(){
					
				}); 
				$.post("addnote.action",{content:content,time:time,contact:touser,views:views,id:dealid})
			});	
			$("#pending").click(function(){
				if(confirm("你确定要跟踪这笔交易吗？")){
					$(this).css("color","#d04cff");
					$(this).next().css("color","#000");
					$(this).next().next().css("color","#000");
					var dealid = $("#dealid").val();
					$.post("editState.action",{state:"跟踪",id:dealid});
				}
			});
			$("#won").click(function(){
				if(confirm("你确定要赢得这笔交易吗？")){
					$(this).css("color","green");
					$(this).prev().css("color","#000");
					$(this).next().css("color","#000");
					var dealid = $("#dealid").val();
					$.post("editState.action",{state:"赢得",id:dealid});
				}
			});
			$("#lost").click(function(){
				if(confirm("你确定丢失这笔交易吗？")){
					$(this).css("color","red");
					$(this).prev().css("color","#000");
					$(this).prev().prev().css("color","#000");
					var dealid = $("#dealid").val();
					$.post("editState.action",{state:"丢失",id:dealid});
				}
			});
			var state = $("#state").val();
			if("跟踪" == state){
				$("#pending").css("color","#2f96b4");
			}else if("赢得" == state){
				$("#won").css("color","green");
			}else if("丢失" == state){
				$("#lost").css("color","red");
			}
			$("#searchContact").suggest("ajaxback.action",{
				
			    suggestionColor   : '#cccccc',
			    moreIndicatorClass: 'suggest-more',
			    moreIndicatorText : '&hellip;'
  
			});
			$(".editnote").click(function(){
				
				
				$(this).parent().parent().parent().fadeOut("4000",function(){
					$(this).next().show();
					
				});
			});
			$(".closebtn").live("click",function(){
				$(this).parent().parent().parent().hide();
				$(this).parent().parent().parent().prev().show();
				
				
			});

			
			$(".complete").click(function(){
				$(this).parent().parent().submit();
			});
			$(".delnote").click(function(){
				if(confirm("确实要删除此记录吗?")){
					$(this).parent().parent().parent().parent().remove();
					var noteid = $(this).parent().prev().val();
					
					$.get("delnote.action",{id:noteid});
				}
			});
			$("#delNewNote").click(function(){
				if(confirm("确实要删除此记录吗?")){
					$(this).parent().parent().parent().remove();
					$.get("delnote.action");
				}
			});
			$("#editNewnote").click(function(){
				$(this).parent().parent().fadeOut("4000",function(){
					$(this).next().show();
			});
				
				var content = $("#content").val();
				var time = $("#datepicker").val();
				var touser = $("#touser").val();
				var views = $("#views").val();
				
				$("#newcontent").html(content);
				$("#datepicker3").val(time);
				$("#newviews").val(views);
				
			});
			$("#dealDeal").click(function(){
				var dealid = $("#dealid").val();
				if(confirm("你确定要删除此交易吗")){
					$(this).attr("href","delDeal.action?id=" + dealid);
				}
				
			});
			 $("#addAnotherDealContact").click(function(){
				$("#another").submit();
				
			});
			$(".delAnotherDealContact").click(function(){
				if(confirm("你确定要删除此交易对象吗？")){
					var companyid = $(this).parent().prev().val();
				
					var dealid = $("#dealid").val();
					$(this).parent().parent().remove();
					$.get("delAnotherDealContact.action",{dealid:dealid,id:companyid});
				}
			}); 
			$("#addTask").live("click",function(){
				$(".box").show();
			});
			$("#canseldiv").click(function(){
				$(".box").hide();
			});
			$("#specifiedTime").click(function(){
				$("#selectTime").hide();
				$("#dateTime").show();
			});
			$("#cansel").click(function(){
				$("#dateTime").hide();
				$("#selectTime").show();
			});
			$(".canselTime").click(function(){
				$(this).parent().hide();
				$(this).parent().prev().show();
			});
			$(".mytask").mouseover(function(){
				$(this).find(".taskdiv").show();
			});
			$(".mytask").mouseout(function(){
				$(this).find(".taskdiv").hide();
			});
			$(".checkbox").live("click",function(){
				$(this).parent().next().remove();
				$(this).parent().css("text-decoration","line-through");
				$(this).parent().css("background-color","yellow");
				$(this).parent().parent().fadeOut("300");
				var taskid = $(this).parent().parent().prev().val();
				$.get("task/delTask.action",{id:taskid});
			});
			$(".deltask").live("click",function(){
				if(confirm("确实要删除这个日程吗？")){
					$(this).parent().parent().remove();
					var taskid = $(this).parent().prev().prev().val();
					$.get("task/delTask.action",{id:taskid});
				}
			});
				$("#addMytask").click(function(){
				$(".box").hide();
				var taskContent = $("#mytaskContext").val();
				var abstractTime = $("#selectTime").val();
				var specifiedTime = $("#datepicker4").val();
				var taskCategory = $("#mytaskCategory").val();
				var taskViews = $("#mytaskViews").val();
				var dealid = $("#dealid").val();
				
				$("#datepicker4").val("");
				$("#mytaskContext").val("");
				$("#dateTime").hide();
				$("#selectTime").show();		
				if(specifiedTime != ""){
					
					$.post("task/addMyTask.action",{taskName:taskContent,specifiedTime:specifiedTime,category:taskCategory,taskViews:taskViews,type:"交易",typeid:dealid},function(data){
						$("#showNewTask").html("");
						$(data).each(function(){
							$("#showNewTask").append("<div style='position:relative;padding-left:15px;' class='mynewtask'><input type='hidden' value='"+this.id+"' id='taskid'><span ><span class='"+this.state+"'>"+this.state+"</span><br/><span><input type='checkbox' style='margin-top:-2px;' name='delcheck' class='checkbox'>&nbsp;<input type='hidden' value='"+this.category.color+"'><span class='taskCategoryType'>"+this.category.type+"</span> &nbsp;<span >"+this.task+"</span></span> <br></span><div class='taskdiv' style='padding-top:3px;'><a href='javascript:;' title='删除' style='margin-left:10px;' class='deltask'><i class='icon-trash'></i></a><a href='javascript:;' style='color:red;text-decoration:underline;' class='editTask'>修改</a></div></div>");
							delState();
							$(".mytask").remove();
							
						})
					})
				}else{
					$.post("task/addMyTask.action",{taskName:taskContent,abstractTime:abstractTime,category:taskCategory,taskViews:taskViews,type:"交易",typeid:dealid},function(data){
						$("#showNewTask").html("");
						$(data).each(function(){
							$("#showNewTask").append("<div style='position:relative;padding-left:15px;' class='mynewtask'><input type='hidden' value='"+this.id+"' id='taskid'><span ><span class='"+this.state+"'>"+this.state+"</span><br/><span><input type='checkbox' style='margin-top:-2px;' name='delcheck' class='checkbox'>&nbsp;<input type='hidden' value='"+this.category.color+"'><span class='taskCategoryType'>"+this.category.type+"</span> &nbsp;<span >"+this.task+"</span></span> <br></span><div class='taskdiv' style='padding-top:3px;'><a href='javascript:;' title='删除' style='margin-left:10px;' class='deltask'><i class='icon-trash'></i></a><a href='javascript:;' style='color:red;text-decoration:underline;' class='editTask'>修改</a></div></div>");
							delState();
							$(".mytask").remove();
						})
					})
				}
			$(".mynewtask").live("mouseover",function(){
				$(this).find(".taskdiv").show();
			});
				$(".mynewtask").live("mouseout",function(){
					$(this).find(".taskdiv").hide();
				});
			});
			$(".newCategoryType").each(function(i){
				var color = $(this).prev().val();
			
			   $(this).css("background-color","#" + color); 
			   $(this).css("color","#fff");
			});
			$(".taskCategoryType").livequery(function(i){
				
				var color = $(this).prev().val();
				
			   $(this).css("background-color","#" + color); 
			   $(this).css("color","#fff");
			
			}); 
			var taskid;
			$(".editTask").live("click",function(){
				var id = $(this).parent().prev().prev().val();
				taskid = id;
				$.get("task/findTaskById.action",{id:id},function(data){
					$("#updateTaskName").val(data.task);
				})
				var p = $(".comment");
				var position = p.position();
				$(".comment").css("top",position.top + 10);
				$(".comment").show("fast");
				
			});
			$(".canselTaskdiv").live("click",function(){
				$(this).parent().parent().parent().fadeOut(300);
			});
			$(".updatespecifiedTime").click(function(){
				$("#updateabstractTime").hide();
				$("#updateDateTime").show();
			});
			 $("#updateTask").live("click",function(){
			 	
				var taskContent = $("#updateTaskName").val();
				var updateabstractTime = $("#updateabstractTime").val();
				var specifiedTime = $("#updateDatepicker").val();
				var updateTaskCategory = $("#updateTaskCategory").val();
				var updateTaskViews = $("#updateTaskViews").val();
				var dealid = $("#dealid").val();
				$.post("task/updateMyTask.action",{id:taskid,taskName:taskContent,abstractTime:updateabstractTime,specifiedTime:specifiedTime,category:updateTaskCategory,taskViews:updateTaskViews,type:"交易",typeid:dealid},function(data){
					$("#showNewTask").html("");
						$(data).each(function(){
							$("#showNewTask").append("<div style='margin-bottom:5px;position:relative;padding-left:15px;' class='mynewtask'><input type='hidden' value='"+this.id+"' id='taskid'><span >"+this.state+"<br/><span><input type='checkbox' style='margin-top:-2px;' name='delcheck' class='checkbox'>&nbsp;<input type='hidden' value='"+this.category.color+"'><span class='taskCategoryType'>"+this.category.type+"</span> &nbsp;<span >"+this.task+"</span></span> <br></span><div class='taskdiv' style='padding-top:3px;'><a href='javascript:;' title='删除' style='margin-left:10px;' class='deltask'><i class='icon-trash'></i></a><a href='javascript:;' style='color:red;text-decoration:underline;' class='editTask'>修改</a></div></div>");
							
							$(".mytask").remove();
						})
				});
				
			}); 
		});
	</script>
</body>
</html>